<%--
  Created by IntelliJ IDEA.
  User: gongsir
  Date: 2019/8/21
  Time: 15:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    pageContext.setAttribute("path",request.getContextPath());
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>编辑影片信息</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="${path}/static/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="${path}/static/css/admin.css" media="all">
		<script type="text/javascript" src="${path}/static/layui/layui.js"></script>
	</head>
	<body>
		<div class="layui-container layui-card">
			<div class="layui-fluid">
				<div class="layui-card-header">
					<h2>编辑影片信息</h2>
				</div>
			</div>
			<div class="layui-fluid layui-card-body">
				<form class="layui-form"  method="post" action="${path}/movie/edit">
					<input type="hidden" name="id" value="${movie.id}">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">影片ID</label>
							<div class="layui-input-block">
								<input type="text" value="${movie.id}" name="id" id="id" placeholder="请输入" required autocomplete="off" class="layui-input" disabled>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">影片名称</label>
							<div class="layui-input-block">
								<input type="text" value="${movie.name}" name="name" id="name" placeholder="请输入" required autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">导演</label>
							<div class="layui-input-block">
								<input type="text" value="${movie.director}" name="director" id="director" placeholder="请输入" required autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">演员</label>
							<div class="layui-input-block">
								<input type="text" value="${movie.action}" name="action" id="action" placeholder="请输入" required autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">发行地</label>
							<div class="layui-input-block">
								<select id="movieDistribution" name="distribution">
									<option value="成都">成都</option>
									<option value="北京">北京</option>
									<option value="上海">上海</option>
									<option value="广州">广州</option>
									<option value="深圳">深圳</option>
									<option value="杭州">杭州</option>
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">上映时间</label>
							<div class="layui-input-block">
								<input type="text" name="date" id="movieDate" required autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">封面图片</label>
							<div class="layui-input-block">
								<input type="text" value="${movie.picUrl}" name="picUrl" id="picUrl" placeholder="请输入" required autocomplete="off" class="layui-input">
								<div style="color: #0000FF">请填写公网地址</div>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">影片链接</label>
							<div class="layui-input-block">
								<input type="text" value="${movie.movieUrl}" name="movieUrl" id="movieUrl" placeholder="请输入" required autocomplete="off" class="layui-input">
								<div style="color: #0000FF">请填写公网地址</div>
							</div>
						</div>
					</div>
					<div class="layui-form-item layui-col-md-offset1">
						<div class="layui-input-inline">
							<input type="submit" id="btn_editImg" class="layui-btn layui-btn-fluid" value="提交">
						</div>
					</div>
					<div class="layui-form-item layui-col-md-offset1">
						<div class="layui-input-inline">
							<button type="button" id="btn_goBack" class="layui-btn layui-btn-fluid" onclick="goBack()">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	<script type="text/javascript">
		layui.use(['form','laydate'],function () {
			var $ = layui.$,
					form = layui.form,
					laydate = layui.laydate;
			laydate.render({
				elem: '#movieDate',
				format: 'yyyy-MM-dd'
			});
			// 动态设置初始值
			$("#movieDate").val("${initDate}");
			// 动态选中select
			$("#movieDistribution").val("${movie.distribution}");
			form.render();
		});
		// 返回上一页
		function goBack(){
			window.history.go(-1);
		}
	</script>
	</body>
</html>
